import axios from "./axios";

export interface ResType<T> {
  code: string;
  msg: T;
}

type Res<T> = Promise<ItypeAPI<T>>;
// 一般情况下响应数据返回的这三个参数，
// 但不排除后端返回其它的可能性，
interface ItypeAPI<T> {
  msg: T; // 返回状态码的信息，如请求成功等
  code: number; //返回后端自定义的200，404，500这种状态码
}

// 首页轮播图
export const indexCarousel = (data: any): Res<any> => {
  return axios.axios.post("index/carousel", data);
};
//查询条件数据
export const indexClassify = (data: any): Res<any> => {
  return axios.axios.post("index/classify", data);
};
//职业类别
export const getJobClassify = (data: any): Res<any> => {
  return axios.axios.post("home/getJobClassify", data);
};
//首页方案列表
export const Index = (data: any): Res<any> => {
  return axios.axios.post("index/index", data);
};
//个人数据
export const indexUser = (data: any): Res<any> => {
  return axios.axios.post("index/user", data);
};
//首页公告数据
export const indexGetIndexNotice = (data: any): Res<any> => {
  return axios.axios.post("index/getIndexNotice", data);
};
//公告列表数据
export const indexGetNotice = (data: any): Res<any> => {
  return axios.axios.post("index/getNotice", data);
};
//保险详情页面
export const indexGetDetail = (data: any): Res<any> => {
  return axios.axios.post("index/getDetail", data);
};
//公告详情
export const indexGetNoticeDetail = (data: any): Res<any> => {
  return axios.axios.post("index/getNoticeDetail", data);
};
//登录接口
export const login = (data: any): Res<any> => {
  return axios.axios.post("login/pwdLogin", data);
};
//获取投保页面信息
export const getInsureInfo = (data: any): Res<any> => {
  return axios.axios.post("home/getInsureInfo", data);
};
//保单提交接口
export const addOrder = (data: any): Res<any> => {
  return axios.axios.post("home/addOrder", data);
};
//获取施工详细地址
export const homeGetAddress = (data: any): Res<any> => {
  return axios.axios.post("home/getAddress", data);
};
//保单列表
export const orderIndex = (data: any): Res<any> => {
  return axios.axios.post("order/index", data);
};
//供应商数据
export const orderGetQueryData = (data: any): Res<any> => {
  return axios.axios.post("order/getQueryData", data);
};
//退出登录
export const outLogin = (data: any): Res<any> => {
  return axios.axios.post("login/outLogin", data);
};
//保单详情
export const orderDetail = (data: any): Res<any> => {
  return axios.axios.post("order/orderDetail", data);
};
//模板导入
export const uploadUser = (data: any): Res<any> => {
  return axios.axios.post("upload/uploadUser", data);
};
//获取保费
export const getPrice = (data: any): Res<any> => {
  return axios.axios.post("home/getPrice", data);
};
//修改密码
export const setPwd = (data: any): Res<any> => {
  return axios.axios.post("home/setPwd", data);
};
//订单删除
export const orderDel = (data: any): Res<any> => {
  return axios.axios.post("order/orderDel", data);
};
//分享
export const getShare = (data: any): Res<any> => {
  return axios.axios.post("index/getShare", data);
};
//支付
export const submitApi = (data: any): Res<any> => {
  return axios.axios.post("home/submitApi", data);
};
//获取电子保单
export const getBd = (data: any): Res<any> => {
  return axios.axios.post("order/getBd", data);
};
//条款
export const getText = (data: any): Res<any> => {
  return axios.axios.post("index/getText", data);
};
//开发票
export const getInvoice = (data: any): Res<any> => {
  return axios.axios.post("order/getInvoice", data);
};
//开专票
export const applyInvoice = (data: any): Res<any> => {
  return axios.axios.post("order/applyInvoice", data);
};
//远程搜索数组数据
export const getBusiness = (data: any): Res<any> => {
  return axios.axios.post("home/getBusiness", data);
};
//远程搜索单个数据
export const getBusinessInfo = (data: any): Res<any> => {
  return axios.axios.post("home/getBusinessInfo", data);
};
//卡片分享
export const getSign = (data: any): Res<any> => {
  return axios.axios.post("Wechat/getSign", data);
};
//自动登录
export const autoLogin = (data: any): Res<any> => {
  return axios.axios.post("login/autoLogin", data);
};
//省市区地址
export const getArea = (data: any): Res<any> => {
  return axios.axios.post("index/getArea", data);
};
//我的业绩数据统计和订单数据
export const achievement = (data: any): Res<any> => {
  return axios.axios.post("order/orderList", data);
};
//我的业绩总佣金
export const achieve = (data: any): Res<any> => {
  return axios.axios.post("order/achieve", data);
};
//验证登录
export const checkLogin = (data: any): Res<any> => {
  return axios.axios.post("login/checkLogin", data);
};
//判断闰年
export const getEndTime = (data: any): Res<any> => {
  return axios.axios.post("home/getEndTime", data);
};
//撤单
export const cancelDadi = (data: any): Res<any> => {
  return axios.axios.post("home/cancelDadi", data);
};
//广福支付
export const gfpay = (data: any): Res<any> => {
  return axios.axios.post("home/gfpay", data);
};
//线下支付
export const imgPay = (data: any): Res<any> => {
  return axios.axios.post("order/imgPay", data);
};
//获取对公支付信息
export const corpPayment = (data: any): Res<any> => {
  return axios.axios.post("home/corpPayment", data);
};
//提交对公支付信息
export const corpFile = (data: any): Res<any> => {
  return axios.axios.post("home/corpFile", data);
};